<%@page import="beans.*"%>
<%@page import="java.util.*"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
</head>
<body>

<div align="center">
		<form method="GET" action="provaVisual.jsp">

		<fieldset style="width: 250px"><legend>
		<center><font color="blue" size="3"><b>Ricerca
		Convenzione</b></font></center>
		</legend>
		<p>
		<center><b>Inserisci Codice Struttura:</b></center>
		<br>

		<input type="text" name="ricerca" value="Ricerca" onfocus="if(this.value==this.defaultValue)this.value=''"><br>
		</br>

		<input class=bottone type="reset" value="Cancella" name="B2">
		<input class=bottone type="submit" value="Ricerca" name="B1"><br></br>
		</fieldset>
		</form>
</div>

<jsp:useBean id="DBcon" scope="page" class="beans.CatalogoConvenzioni" />

<%

if (request.getParameter("ricerca") != null) {
	int ricerca = Integer.parseInt(request.getParameter("ricerca"));

	String frigo=null;
	Vector<Convenzione> conv=DBcon.getConvenzioniEnte(ricerca); //ricerca nel DB dei libri che hanno quel titolo

	out.println("<TABLE align=\"center\" cellspacing=0; cellpadding=5 BORDER=\"1\">");
	out.println("<TR>");
	out.println("<TD><TH>Id Ente</TH></TD>");
	
	for(int i=0;i<conv.size();i++)
	out.println("<TD align=\"center\">" + conv.get(i).getIdEnte()+ "</TD>");
	out.println("</TR>");
	
	out.println("<TR>");
	out.println("<TD><TH>Anno</TH></TD>");
	for(int i=0;i<conv.size();i++)
	out.println("<TD align=\"center\">" + conv.get(i).getAnno()+ "</TD>");
	out.println("</TR>");
	
	
	out.println("<TR>");
	out.println("<TD><TH align=\"center\">Struttura Frigorifera</TH></TD>");

	for(int i=0;i<conv.size();i++){
	
	if(conv.get(i).isCellaFrigo())
		frigo="si";
	else
		frigo="no";
	
	out.println("<TD align=\"center\">" +  frigo + "</TD>");
	}
	out.println("</TR>");

	out.println("</TABLE>");

}
 %>



</body>
</html>